home *** CD-ROM | disk | FTP | other *** search
-
- -- !Help -- !iicAlarm 1.00
-
- by Andreas Barth, May 1994
-
- A hardware expansion to automatically switch the computer on and off.
-
- !iicAlarm uses the alarm-functions of the standard Archimedes clock-chip
- PFC8583, which are currently unused.
- It allows setting an alarm-time and switching an alarm-line at that time.
- Using a small circuit, this alarmline can be used to switch the computer on.
- Under the Desktop, the !Alarm-Application calls the desired programs as
- nescessary. At the end of an automatic session, the next alarmtime is set
- and the computer switches off via program control.
-
- Requires RiscOS 3.
-
- Introduction
- ------------
- The clock-chip inside the Archimedes is a PCF8583, a clock with calendar,
- Alarm, Timer and RAM. The alarm can drive an open-collector-output.
- The chip has got 256 Bytes of address-space. That are 240 Bytes of CMOS Ram,
- 8 Bytes of clock informations and 8 Bytes for unused alarm-registers which
- may be used as Ram as long as the alarm-system is disabled.
- RISC OS doesn't use the 8 bytes of the alarm-system (up to now).
- The chip has got an output that can be set by the alarm-system and is suitable
- to switch something at a specific time. Using a simple flipflop-circuit with an
- input delay of several seconds and an output that can drive a relay or a
- solid-state-relay, we can switch a high-voltage load, at last our own computer.
- In the end, we need some software, that examines the clock-status and sets
- the alarm-time.
- To keep things simple, I use the !Alarm-application to manage time-events.
- Under Risc OS 3, !Alarm can handle Task-alarms, meaning that you can call a
- program or *Command or batchfile at a given time with a given repeat rate.
- It seemed sensible to use these task-alarm entries in an alarm-database to
- set the next alarm-time inside the clock-chip, since it is only necessary to
- write an alarm-database-reader that extracts the next task-alarm-time.
- Setup and updating of the alarms is completely up to the !Alarm-application.
-
- Software
- --------
- During all phases of running, the computer needs some programs to control
- the alarm clock.
- Five small programs perform all the work.
-
- So the following should happen:
- <The computer is switched on and wants to boot from floppy- or harddisc>
- - Early in the Boot-sequence, the variable <Alarmfile> is set.
- e.g. *Set Alarmfile System:Alarms
- It should point to the standard Alarm-file used by you in your Desktop
- environment. !iicAlarm uses this file to determine the next Task-Alarm-
- time which is then loaded into the clock-alarm-register.
-
- - !iicAlarm -- is to be called during the boot-sequence, possibly before
- the Desktop is started.
- It determines whether the computer was automatically started or not,
- and sets the variable <AlarmMode> accordingly.
- (Reads the <Alarmfile> to determine the next Task-Alarm-time.
- BUG: If the actual alarm-time is a repeated one, which takes place before
- the next Task-alarm-record in the file, then this is ignored.)
- This also installs a small module that captures your <ShiftControlF12>-key
- and performs a new shutdown-sequence.
-
- - Start !Alarm with <Alarmfile> as argument when you enter the Desktop.
- !Alarm performs all actions to task-alarms and repeated alarms just as
- normal.
-
-
- - !AlarmOff -- *AlarmOff
- Can always be used to switch off the alarm-system.
- The clock is put to Alarm-mode with alarms disabled.
-
- - !AlarmOn -- *AlarmOn
- Can always be used to reinitialise the alarmsystem.
- Performs a call to !AlarmOff and AlarmSet which will set the user mode
- and the clock to the next task-alarm-time found in the file.
-
-
- - !AlarmQuit -- *AlarmQuit
- To end your automatic batchfiles, you can call this program.
- It does nothing if the user has switched on the computer,
- and it simply switches the computer off if the mode indicates an
- automatic run. It does not "Shutdown" the desktop !
-
- - !AlarmShut -- *AlarmShut, *Bye
- Shutdown-Application for Desktop-use. Should replace the Taskmanagers
- <Shift-Control-F12> and quits all Applications, sets the next alarm-time
- and switches the computer off.
-
- These programs can be called by CLI-commands as well. There are Aliases
- in the !AlarmBoot-Sequence.
- You can simply call '*AlarmQuit' at the end of your automatic program.
-
- - The keyScan-module links itself into the InsV-vector and captures the
- standard exit-key <scF12>. Under the Wimp, it installs a small module-task
- that initiates a wimptask-command when the key is pressed.
- One press will perform a "*Filer_Opendir ...Tools"
- two presses will call "*AlarmShut"
- The Shutdown-command in the TaskManager-menu is unaffected and you cannot
- switch off your computer with that.
-
-
- Hardware
- --------
- Note !
- - The circuit is for A3xx/A4xx/A3000 only, because it uses the
- Auxiliary-IO-port (Alarm and Aux1/2), which is normally unused and not fitted.
- - A3000 don't have an AuxIOport. You have to make it yourself.
- Necessary are: Alarm: IC6, pin 7 -> pin 5 of our AuxIO-connector.
- Aux 1: IC18 pin 17 -> pin 3 of our AuxIO-connector.
- Aux 2: IC18 pin 18 -> pin 2 of out AuxIO-connector.
- - New computers (A3010,3020,4000,5000) with the new IOEB don't have an
- AuxIOport and don't have Aux1/2. No way here.
- - If you have a good VIDC-enhancer then this is switched by Aux1/2.
- No good for our purpose. Determine which bit it uses and take the other
- one for our circuit. Change the Bit in program 'SwitchOff' and '!AlarmShut'
- just before the CALL is made. Bit 0 and Bit 1 are Aux1 and 2 respectively.
-
- Function
- The clock-chip inside the Archimedes is a PCF8583, a clock with calendar,
- Alarm, Timer and RAM. The alarm can drive an open-collector-output.
- There are various modes for an alarm: Timeralarm, daily alarm, weekday
- and dated. We only use the dated alarm.
- By default (eg. after changing the battery) the alarmsystem is off and the
- alarm-line shows a one second clock signal. So our little circuit has to be
- safe enough to filter this out (we don't want our computer to be switched on
- and off every second, don't we).
- The circuit should consume very low energy and should be simple.
-
- Have a look at the circuit and pcb-drawings.
- Its really simple. The circuit is very high impedance and needs only
- about 6uA in standby-mode at 3V.
- It's a simple FlipFlop-circuit with ALARM at the SET-input and AUX1 or 2 at
- the RESET-input. The first gate simply produces a known voltage/current
- output, feeding a RC-combination which acts as time-delay for the real
- flipflop. The input-signal has to be stable for about 5 seconds to actually
- set or reset the FF.
-
- Connections
- The completed circuit has 5 connectors:
- 1) Auxiliary-I/O-Connector
- 5pins, connects to PL10 in an A3xx/4xx. Pin 1 ist marked on both sides.
- The pins up from '1' are: Gnd, Aux2, Aux1, C4, Alarm.
- 2) and 3) Power and battery-connector
- 2pins each. Connect one with the battery (or a new one with 3V),
- and the second with the internal +5V supply. This is easily to be found
- on the floppy-disc-power-connector, where the marked cable is +5V, then
- Gnd, Gnd and +12V.
- 4) Switch
- 2pins. Gives a supply secured with a 47ohm resistance.
- The ground pin is switched by a BS108 VMOSFET (I just have had this one in my
- toolbox, so I took it. No real reason for that). This thing can resist
- 200V and source max. 260mA (although our battery wouldn't do that).
- I use a solid-state-relais which is driven by an LED and hence
- works with 3V and 1.2mA. (But these cannot drive inductive loads)
- 5) On/Off-switch
- The circuit version 1.00 has got a second input in parallet to the alarm
- input. It takes about 5 seconds to switch the computer on with that input.
- I made a change in the circuit-plan to allow a switch to set and reset the
- flip-flop. You can install a presskey on the front of your Archimedes to
- switch the system on and off more comfortable.
- This switch DOESN'T WORK if the alarm line is active and as long as the
- alarm line is active, because this sets the flipflop all the time, disabling
- the reset-input.
- So you need at least a piece of software that switches the alarm-line off.
- Every !iicAlarm-tool can do that, but without it you only can unplug the
- cable. - The next circuit will be better.
-
- The end
- -------
- !iicAlarm is copyright by me and may be used and copied for non-profit use,
- and as long as every part is included in the copy without changes.
- I take no liabilities for whatsoever.
- If you like to give me some comments, write to:
- Andreas Barth
- Karl-Eberhardstr. 9
- W-51643 Gummersbach
- Germany
- Tel. 0049 2261/27042
- EMail: Andreas_Barth@ruba.rz.ruhr-uni-bochum.de (valid till Sept. 1994)
-
- ToDo
- -----
- Well, it works, eh ?
- - Pack everything in a small module.
- - build a better circuit.
-